package com.lzh.exer;

import java.util.Calendar;
import java.util.Scanner;

public class PayrollSystem {
	public static void main(String[] args) {
		//方式一：
//		Scanner sc = new Scanner(System.in);
//		System.out.println("请输入当月的月份：");
//		int month = sc.nextInt();
		
		//方式二
		Calendar calendar = Calendar.getInstance();
		int month = calendar.get(Calendar.MONTH);
		//System.out.println(month);//一月份
		
		Employee[] emps = new Employee[2];
		
		emps[0] = new SalariedEmployee("刘智豪", 1002, new MyDate(1998,9,17),10000);
		emps[1] = new HourlyEmployee("尹嘉琪",1003, new MyDate(2000,1,8),60,240);
		
		for(int i=0;i<emps.length;i++) {
			System.out.println(emps[i]);
			double salary = emps[i].earnings();
			System.out.println("月工资为： "+salary);
			
			if(month++ == emps[i].getBirthday().getMonth()) {
				System.out.println("生日快乐，奖励一百元");
			}
		}
	}
}
